import { getTplList } from '@/services/tpl';
import { filterObj } from '@/utils';
export default {
  name: 'tpl',
  namespaced: true,
  state: {
    tplListSource: null
  },
  mutations: {
    setTplList(state, val) {
      state.tplListSource = val;
    }
  },
  actions: {
    async getTplList({ commit }, params) {
      await getTplList(filterObj(params)).then(res => {
        commit('setTplList', res.data || null)
      }).catch(() => {
        commit('setTplList', null)
      })
    }
  }
}